<?php
class retrieve_paymentgateway_admin extends retrieve_base{

	private $module_display_options 			= array();
	/*************************************************************************************************************************
	* function produces abstract structure of modules db structure
	*
	* used to generate the table structure required abstract function that passes an abstract
	* representation of the desired table structure to the proper database module which will
	* interpet the abstract and convert it into a valid SQL Create table structure.
	*
	* @return Array list of abstract table definitions for this module
	*************************************************************************************************************************/
	function create_table(){
		$tables = array();
		/*************************************************************************************************************************
		* Table structure for table 'payment_account_details'
		*
		* Payment details for different paysysttems differ greatly this table holds the key pairs of variable/value
		*************************************************************************************************************************/
		$fields = array(
			array("pad_identifier"		,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pad_client"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pad_uri"				,"varchar (255)"			,"NOT NULL"	,"default '0'","key"),
			array("pad_confirm_msg"		,"text"						,"NOT NULL"	,"default ''"),
			array("pad_deny_msg"		,"text"						,"NOT NULL"	,"default ''")
		);
		$primary ="pad_identifier";
		$tables[count($tables)] = array("payment_account_details", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'payment_account_properties'
		*
		* Payment details for different paysysttems differ greatly this table holds the key pairs of variable/value
		* the pap_identifier is mapped to the pad_identifier field
		*************************************************************************************************************************/
		$fields = array(
			array("pap_identifier"		,"unsigned integer"			,"NOT NULL"	,"default '0'"), // link to PAD owner
			array("pap_client"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pap_property"		,"varchar (255)"			,"NOT NULL"	,"default '0'","key"),
			array("pap_value"			,"varchar (255)"			,"NOT NULL"	,"default '0'","key")
		);
		$primary ="";
		$tables[count($tables)] = array("payment_account_properties", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'payment_account_orders'
		*
		* Record that links to the shop basket and holds status of the order process fromthe payment system
		*************************************************************************************************************************/
		$fields = array(
			array("pao_identifier"		,"unsigned integer"			,"NOT NULL"	,"default '0'","key"), // 
			array("pao_pad"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"), // maps to the payment_account_details table pad_identifier
			array("pao_client"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pao_user"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pao_basket"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pao_status"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pao_sent"			,"datetime"					,"NOT NULL"	,""), // date time order request sent
			array("pao_approved"		,"datetime"					,"NOT NULL"	,"")  // date time order request approved
		);
		$primary ="pao_identifier";
		$tables[count($tables)] = array("payment_account_orders", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'payment_order_properties'
		*
		* Extra payment properties for the basket specific for this Payment Module this table holds the key pairs of variable/value
		* the pop_identifier is mapped to the pao_identifier field
		*************************************************************************************************************************/
		$fields = array(
			array("pop_identifier"		,"unsigned integer"			,"NOT NULL"	,"default '0'"), // link to PAO owner
			array("pop_client"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("pop_property"		,"varchar (255)"			,"NOT NULL"	,"default '0'","key"),
			array("pop_value"			,"varchar (255)"			,"NOT NULL"	,"default '0'","key")
		);
		$primary ="";
		$tables[count($tables)] = array("payment_order_properties", $fields, $primary);
		return $tables;
	}
}
?>